<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Login extends Accounts
  {
    public function Very_Login()
    {
      if(empty($this->name)) {
        return false;
      } else {
        $var = new Accounts();
        $var->where('name', $this->name);
        $var->where('password', $this->password);
        $var->get();
        
        if($var->exists()) {
          $this->storage = array();
          $this->storage2 = $var->all;
          foreach ($var->all as $user)
          {  
                         
              return $this->storage = $user;
          }
        } else { 
            // Login failed, so set a custom error message
            $this->error_message('login', 'Username or password invalid'); 
        }
      }
    }
  }

/* End of file accounts.php */
/* Location: ./application/models/accouunts.php */